package com.authine.cloudpivot.ext.enums.order;

/**
 * @author Kris
 * Created on 2019/2/27
 */
public enum BehaviorEnum {

    APPLY_REFUND(0, "申请退款"),
    AGREE_REFUND(1, "同意退款"),
    REFUSE_REFUND(2, "拒绝退款"),
    RETURN(3, "发起退货物流"),
    CONFIRM_RECEIVED(4, "确认到货"),
    FINANCE_CONFIRMED(5, "财务已确认");


    public Integer id;
    public String text;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    BehaviorEnum(Integer id, String text) {

        this.id = id;
        this.text = text;
    }

    public static BehaviorEnum get(Integer code) {

        for (BehaviorEnum c : BehaviorEnum.values()) {
            if (c.id.toString().equals(code.toString())) {
                return c;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return text;
    }
}
